<?php


namespace app\zhongcan\controller;

use cmf\controller\AdminBaseController;
use think\facade\Db;

class BannerController extends AdminBaseController
{
    public function index()
    {
        return "<a href='add'>1</a>";
    }

    public function add()
    {

        return $this->fetch('add');
    }

    public function addPost()
    {
        $image = $_POST['image'];
        $image = cmf_get_image_url($image);
        $res = Db::name('banner')->save([
            'image' => $image,
            'url' => '#'
        ]);
    }
}